
let obj = {
    a: 1
}

// obj.__proto__.test = function () {
//     console.log('1111')
// }

// obj.test()

// Object.prototype.test()

// let obj2 = Object.create(obj)
// console.log(obj2.test())


Object.prototype.myCreate = function (target) {
    function fn() { }
    fn.prototype = target
    return new fn()
}

let obj2 = Object.myCreate(obj)
console.log(obj2.__proto__.a) //1

/***
 *  将result的prototype指向target
 */